/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dao.ibatis;

import model.dao.ActaReunionDao;
import com.ibatis.sqlmap.client.SqlMapClient;
import model.bean.ActaReunion;
import java.util.List;
import java.util.Map;
import model.common.ibatis.IbatisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

/**
 * @Archivo ActaReunionDaoIbatis.java
 * @Fecha                @Autor   @Cambios
 * 21/01/2011 04:06:26 PM       moshiro
 */
@Repository
public class ActaReunionDaoIbatis extends SqlMapClientDaoSupport implements ActaReunionDao {

    @Autowired
    public ActaReunionDaoIbatis(SqlMapClient arg) {
        setSqlMapClient(arg);
    }

    public Long agregarActaReunion(ActaReunion actaReunion) throws DataAccessException {
        Map parameterMap = IbatisUtils.processBean(actaReunion);
        return ((Long) getSqlMapClientTemplate().queryForObject("agregarActaReunion", parameterMap)).longValue();
    }

    public Integer modificarActaReunion(ActaReunion actaReunion) throws DataAccessException {
        Map parameterMap = IbatisUtils.processBean(actaReunion);
        return ((Integer) getSqlMapClientTemplate().update("modificarActaReunion", parameterMap));
    }

    public Integer cerrarActaReunion(Long codigo) throws DataAccessException {
        ActaReunion ActaReunion = new ActaReunion();
        ActaReunion.setCodigo(codigo);
        return ((Integer) getSqlMapClientTemplate().delete("cerrarActaReunion", ActaReunion));
    }

    public Integer eliminarActaReunion(Long codigo) throws DataAccessException {
        ActaReunion ActaReunion = new ActaReunion();
        ActaReunion.setCodigo(codigo);
        return ((Integer) getSqlMapClientTemplate().delete("eliminarActaReunion", ActaReunion));
    }

    public List<ActaReunion> listarActaReunion(ActaReunion actaReunion) throws DataAccessException {
        Map parameterMap = IbatisUtils.processBean(actaReunion);
        return getSqlMapClientTemplate().queryForList("listarActaReunion", parameterMap);
    }
}
